package norbert.utils {
	import flash.events.Event;
	import flash.events.EventDispatcher;
	
	import mx.binding.utils.ChangeWatcher;
	import mx.core.Application;
	import mx.core.IMXMLObject;
	import mx.core.UIComponent;
	import mx.logging.ILogger;
	import mx.logging.Log;
	import flash.display.DisplayObjectContainer;
	import mx.binding.utils.BindingUtils;

	public class MXMLObject extends EventDispatcher implements IMXMLObject {
		private static var logger:ILogger = Log.getLogger("norbert.utils.MXMLObject");
		
		[Bindable]
		public var id: String;
		[Bindable]
		public var document: Object;

		public var owner: DisplayObjectContainer;
		
		public function initialized(document:Object, id:String):void 	{
			this.document = document;
			this.id = id;
			
			if (document is DisplayObjectContainer) {
				owner = DisplayObjectContainer(document);
			} else if (document is MXMLObject) {
				owner = MXMLObject(document).owner;
			}
		}
	}
}
